import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";

export default defineConfig({
  // ...
  plugins: [
    vue(),
    // ...
    AutoImport({
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),
  ],

  /**
   * 
   * 这里引入的是适配 @/绝对路径 可用可不用
   * 
    import { resolve } from "path";
    resolve: {
    alias: {
      "@": resolve(__dirname, "./src"),
    },
   },
   css: {
    //配置 CSS modules 的行为。选项将被传递给 postcss-modules。
    modules: {},
    //指定传递给 CSS 预处理器的选项
    preprocessorOptions: {
      scss: {
        additionalData: `$injectedColor: orange;`,
      },
    },
    //开发过程中是否启sourcemap
    devSourcemap: false,
    },
   base: "./",
   */
});
